package com.spring.security.web.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.spring.security.web.model.Log;

/**
 * 日志
 * @author WoJunyu
 *
 */
@Controller
@RequestMapping("/log")
public class LogController extends BaseController{
	
//	@Resource private MongoTemplate mongoService;
	
	@RequestMapping("/layoutIndex")
    public ModelAndView layoutIndex() {
        return new ModelAndView("main/index");
    }
	
	@RequestMapping("/logIndex")
    public ModelAndView logIndex() {
        return new ModelAndView("main/log/index");
    }
	
	@ResponseBody
    @RequestMapping(value="/list"/*, method = RequestMethod.POST*/)
    public Object list(String page,String rows) throws Exception{
		Map<String, Object> retD = new HashMap<String, Object>();
		List<Log> logList = new ArrayList<Log>();
		Log e = new Log();
		e.setHostAddr("aaa");
		e.setMethod("action");
		logList.add(e);
		logList.add(e);
		logList.add(e);
		logList.add(e);
		logList.add(e);
		logList.add(e);
		logList.add(e);
		logList.add(e);
		retD.put("total", 20);
	    retD.put("rows", logList);
	    return retD;
    }
}
